home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / usr_-_Usr_Files / INCLUDE / WCHAR.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  6KB  |  169 lines

  1. /* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3.  
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public License as
  6. published by the Free Software Foundation; either version 2 of the
  7. License, or (at your option) any later version.
  8.  
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. Library General Public License for more details.
  13.  
  14. You should have received a copy of the GNU Library General Public
  15. License along with the GNU C Library; see the file COPYING.LIB.  If
  16. not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  17. Cambridge, MA 02139, USA.  */
  18.  
  19. /*
  20.  *      ISO Standard: 7.16.4 General wide-string utilities    <wchar.h>
  21.  */
  22.  
  23. #ifndef _WCHAR_H
  24.  
  25. #define _WCHAR_H 1
  26. #include <features.h>
  27.  
  28. __BEGIN_DECLS
  29.  
  30. /* Get size_t, wchar_t, uwchar_t and NULL from <stddef.h>.  */
  31. #define __need_size_t
  32. #define __need_wchar_t
  33. /* #define __need_uwchar_t */
  34. #define __need_NULL
  35. /* __need_WCHAR_MAX */
  36. /* __need_WCHAR_MIN */
  37. #include <stddef.h>
  38.  
  39. /* FIXME: Should go with this or another name in stddef.h.  */
  40. typedef unsigned int uwchar_t;
  41.  
  42. /* Conversion state information.  */
  43. typedef int mbstate_t; /* FIXME */
  44.  
  45. /* Should come from <stddef.h> */
  46. #define WCHAR_MIN ((wchar_t) 0)    /* FIXME */
  47. #define WCHAR_MAX (~WCHAR_MIN)    /* FIXME */
  48.  
  49. #ifndef WEOF
  50. # define WEOF (0xffffffffu)
  51. #endif
  52.  
  53. /* FIXME: should this go into <stddef.h>???  */
  54. #if 0
  55. #define __need_wint_t
  56. #include <stddef.h>
  57. #else
  58. /* Integral type unchanged by default argument promotions that can
  59.    hold any value corresponding to members of the extended character
  60.    set, as well as at least one value that does not correspond to any
  61.    member of the extended character set.  */
  62. typedef unsigned int wint_t;
  63. #endif
  64.  
  65.  
  66. /* Copy SRC to DEST.  */
  67. extern wchar_t *wcscpy __P ((wchar_t *__dest, __const wchar_t *__src));
  68. /* Copy no more than N wide-characters of SRC to DEST.  */
  69. extern wchar_t *wcsncpy __P ((wchar_t *__dest, __const wchar_t *__src,
  70.                   size_t __n));
  71.  
  72. /* Append SRC onto DEST.  */
  73. extern wchar_t *wcscat __P ((wchar_t *__dest, __const wchar_t *__src));
  74. /* Append no more than N wide-characters of SRC onto DEST.  */
  75. extern wchar_t *wcsncat __P ((wchar_t *__dest, __const wchar_t *__src,
  76.                   size_t __n));
  77.  
  78. /* Compare S1 and S2.  */
  79. extern int wcscmp __P ((__const wchar_t *__s1, __const wchar_t *__s2));
  80. /* Compare N wide-characters of S1 and S2.  */
  81. extern int wcsncmp __P ((__const wchar_t *__s1, __const wchar_t *__s2,
  82.              size_t __n));
  83.  
  84. /* Duplicate S, returning an identical malloc'd string.  */
  85. extern wchar_t *wcsdup __P ((__const wchar_t *__s));
  86.  
  87. /* Find the first occurence of WC in WCS.  */
  88. extern wchar_t *wcschr __P ((__const wchar_t *__wcs, wchar_t __wc));
  89. /* Find the last occurence of WC in WCS.  */
  90. extern wchar_t *wcsrchr __P ((__const wchar_t *__wcs, wchar_t __wc));
  91.  
  92. /* Return the length of the initial segmet of WCS which
  93.    consists entirely of wide-characters not in REJECT.  */
  94. extern size_t wcscspn __P ((__const wchar_t *__wcs,
  95.                 __const wchar_t *__reject));
  96. /* Return the length of the initial segmet of WCS which
  97.    consists entirely of wide-characters in  ACCEPT.  */
  98. extern size_t wcsspn __P ((__const wchar_t *__wcs, __const wchar_t *__accept));
  99. /* Find the first occurence in WCS of any character in ACCEPT.  */
  100. extern wchar_t *wcspbrk __P ((__const wchar_t *__wcs,
  101.                   __const wchar_t *__accept));
  102. /* Find the first occurence of NEEDLE in HAYSTACK.  */
  103. extern wchar_t *wcsstr __P ((__const wchar_t *__haystack,
  104.                  __const wchar_t *__needle));
  105. /* Divide WCS into tokens separated by characters in DELIM.  */
  106. extern wchar_t *wcstok __P ((wchar_t *__s, __const wchar_t *__delim,
  107.                  wchar_t **ptr));
  108.  
  109. /* Return the number of wide-characters in S.  */
  110. extern size_t wcslen __P ((__const wchar_t *__s));
  111.  
  112.  
  113. /* Search N bytes of S for C.  */
  114. extern wchar_t *wmemchr __P ((__const wchar_t *__s, wchar_t __c, size_t __n));
  115.  
  116. /* Compare N bytes of S1 and S2.  */
  117. extern int wmemcmp __P ((__const wchar_t *__s1, __const wchar_t *__s2,
  118.              size_t __n));
  119.  
  120. /* Copy N bytes of SRC to DEST.  */
  121. extern wchar_t *wmemcpy __P ((wchar_t *__s1, __const wchar_t *__s2,
  122.                   size_t __n));
  123.  
  124. /* Copy N bytes of SRC to DEST, guaranteeing
  125.    correct behavior for overlapping strings.  */
  126. extern wchar_t *wmemmove __P ((wchar_t *__s1, __const wchar_t *__s2,
  127.                    size_t __N));
  128.  
  129. /* Set N bytes of S to C.  */
  130. extern wchar_t *wmemset __P ((wchar_t *__s, wchar_t __c, size_t __n));
  131.  
  132.  
  133. /* Determine whether C constitutes a valid (one-byte) multibyte
  134.    character.  */
  135. extern wint_t btowc __P ((int __c));
  136.  
  137. /* Determine whether C corresponds to a member of the extended
  138.    character set whose multibyte representation is a single byte.  */
  139. extern int wctob __P ((wint_t __c));
  140.  
  141. /* Determine whether PS points to an object representing the initial
  142.    state.  */
  143. extern int mbsinit __P ((__const mbstate_t *__ps));
  144.  
  145. /* Return number of bytes in multibyte character pointed to by S.  */
  146. extern size_t mbrlen __P ((__const char *__s, size_t __n, mbstate_t *ps));
  147.  
  148. /* Write wide character representation of multibyte character pointed
  149.    to by S to PWC.  */
  150. extern size_t mbrtowc __P ((wchar_t *__pwc, __const char *__s, size_t __n,
  151.                 mbstate_t *__p));
  152.  
  153. /* Write multibyte representation of wide character WC to S.  */
  154. extern size_t wcrtomb __P ((char *__s, wchar_t __wc, mbstate_t *__ps));
  155.  
  156. /* Write wide character representation of multibyte chracter string SRC
  157.    to DST.  */
  158. extern size_t mbsrtowcs __P ((wchar_t *__dst, __const char **__src,
  159.                   size_t __len, mbstate_t *__ps));
  160.  
  161. /* Write multibyte character representation of wide character string
  162.    SRC to DST.  */
  163. extern size_t wcsrtombs __P ((char *__dst, __const wchar_t **__src,
  164.                   size_t __len, mbstate_t *__ps));
  165.  
  166. __END_DECLS
  167.  
  168. #endif /* wchar.h  */
  169.